<template>
  <el-container class="app-container">
    <el-header v-if="isAuthenticated">
      <nav-bar />
    </el-header>
    
    <el-main>
      <router-view />
    </el-main>
  </el-container>
</template>

<script>
import { computed, onMounted } from 'vue'
import { useUserStore } from './stores/user'
import NavBar from './components/NavBar.vue'
import { http } from './utils/http'
import { useRouter } from 'vue-router'

export default {
  name: 'App',
  components: {
    NavBar
  },
  setup() {
    const userStore = useUserStore()
    const isAuthenticated = computed(() => userStore.isAuthenticated)
    const router = useRouter()

    return {
      isAuthenticated
    }
  }
}
</script>

<style>
.app-container {
  min-height: 100vh;
}

.el-header {
  padding: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.el-main {
  padding: 20px;
  background-color: #f5f7fa;
}
</style>
